<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<style>
  .a{
    width: 500px;
    height: 500px;
    background-color: gray;
    /*margin: 0 auto;*/
    position: relative;
  }
  .b{
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%,-50%);
  }
  /*span{*/
  /*  background-color: aqua;*/
  /*  position: relative;*/
  /*  top: 50%;*/
  /*  transform: translate(0, -50%);*/
  /*}*/
  img{
    border: pink 1px solid;
    width: 100px;
    height: 100px;
    /*!*只针对行内元素或者行内块元素 行内元素的基线相对于该元素所在行的基线的垂直对齐*!*/
    vertical-align: middle;
    /*position: relative;*/
    /*top: 50%;*/
    /*transform: translate(0,-50%);*/
  }
</style>
<body>
  <div class="a">
    <div class="b">
      <span>X123456</span>
      <img src="../image/sg13.png" alt="">
    </div>
  </div>
</body>
</html>